/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.frogs.manager;

import com.frogs.data.AbstractManager;
import com.frogs.exception.FrogsFindException;
import com.frogs.exception.FrogsMergeException;
import com.frogs.exception.FrogsPersistException;
import com.frogs.exception.FrogsRemoveException;
import com.frogs.model.Sucursal;
import com.frogs.model.SucursalPK;

import java.util.List;
import javax.persistence.EntityManager;

/**
 *
 * @author gabrielbran
 */
public class ManagerSucursal extends AbstractManager {

    public ManagerSucursal() {
        super();
    }

    public Sucursal guardaSucursal(Sucursal s) throws FrogsPersistException {
        return (Sucursal) super.persistObject(s);
    }

    public Sucursal actualizaSucursal(Sucursal s) throws FrogsMergeException {
        return (Sucursal) super.mergeObject(s);
    }

    public void eliminaSucursal(Sucursal s) throws FrogsRemoveException  {
        super.removeObject(s);
    }

    public List<Sucursal> getListaSucursales() throws FrogsFindException {
        return (List<Sucursal>) super.getEntityList();
    }

    public Sucursal buscarSucursal(SucursalPK spk) throws Exception {
        return (Sucursal) super.findById(spk);
    }

    @Override
    public EntityManager getEm() {
        return super.getEm();
    }

    @Override
    public String getEntityName() {
        return "Sucursal";
    }
}
